#include "pch.h"
#include "DrawSquare.h"

int DrawSquare::draw(CDC* pDC,int startx, int starty, int endx, int endy, COLORREF color)
{
	for (int i = startx; i < endx; i++)
	{
		pDC->SetPixel(i, endy,color);
		pDC->SetPixel(i, starty, color);

	}
	for (int i = endx; i < startx; i++)
	{
		pDC->SetPixel(i, endy, color);
		pDC->SetPixel(i, starty, color);

	}
	for (int i = starty; i < endy; i++)
	{
		pDC->SetPixel(startx, i, color);
		pDC->SetPixel(endx, i, color);
	}
	for (int i = endy; i < starty; i++)
	{
		pDC->SetPixel(startx, i, color);
		pDC->SetPixel(endx, i, color);
	}
	return 1;
}


